<?php
date_default_timezone_set('Asia/Ho_Chi_Minh');
define('DS',DIRECTORY_SEPARATOR);

//require yii framework
$root 	= 	dirname(__FILE__);
$yii	=	$root.'/common/libs/framework/yii.php';
require_once($yii);

//require config
$base	=	require($root.'/common/config/main.php');
$debug	=	require($root.'/common/config/debug.php');
$frontend=	require($root.'/protected/config/frontend.php');

	
if(isset($_GET['mode']) && $_GET['mode']=='dev'){
	defined('YII_DEBUG') or define('YII_DEBUG',true);
	defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
	$config	=	CMap::mergeArray($base, $frontend,  $debug);
}else{
	defined('YII_DEBUG') or define('YII_DEBUG',false);
	$config	=	CMap::mergeArray($base, $frontend);
}
Yii::createWebApplication($config)->run();
